﻿
@{
    ViewBag.Title = "LevelOne";
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
}

<table style="width:100%" class="formtable">
    <tbody>
        <tr>
            <td>
                <div class="easyui-panel" style="padding:2px;width:100%">
                    <iframe id="ifLineStack3" src="" style="width:100%; height:250px;" frameborder="0"></iframe>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="hr"></div>
                <div title="车辆月进煤信息" class="easyui-panel" style="padding:2px;width:100%">
                    <table id="StatList" style="width:100%"></table>
                </div>
            </td>
        </tr>
    </tbody>
</table>
<script type="text/javascript">
    function QueryStatReport3(){
        $("#ifLineStack3").attr("src","@Url.Action("LineStack3", "Home")?LPR=@ViewBag.LPR&QueryYear=@ViewBag.QueryYear&QueryMonth=@ViewBag.QueryMonth");
    }
    $(function () {
        $('#StatList').datagrid({
            url: '@Url.Action("QueryCarWeighting")',
            width:SetGridWidthSub(10),
            methord: 'post',
            height: SetGridHeightSub(300),
            fitColumns: true,
            sortName: 'PLAN_DATE',
            sortOrder: 'desc',
            idField: 'BATCH_CODE',
            pagination: false,
            striped: true, //奇偶行是否区分
            singleSelect: true,//单选模式
            onLoadSuccess: function(data) {
                ////默认选中第一行
                //var rows = $('#StatList').datagrid('getRows');
                //if (rows != null && rows.length > 0) {
                //    $('#StatList').datagrid('selectRow', 0);

                //    QueryStatReport3(rows[0].MATERIEL_ID,rows[0].SUPPLIER_ID,rows[0].TRANSPORT_ID,rows[0].LPR);
                //}
            },
            columns: [[
                { field: 'PLAN_DATE', title: '计划日期', width: 110,formatter:DateTimeFormatterToDate },
                { field: 'LPR', title: '车牌号', width: 90 },
                { field: 'SUPPLIER_NAME', title: '供应商', width: 220 },
                { field: 'TRANSPORT_NAME', title: '运输商', width: 220 },
                { field: 'MATERIEL_NAME', title: '物料名称', width: 100 },
                { field: 'BILL_WEIGHT', title: '票重', width: 60},
                { field: 'GROSS', title: '毛重', width: 50},
                { field: 'TARE', title: '皮重', width: 50},
                { field: 'NET', title: '净重', width: 50},
                { field: 'COEFFECENT', title: '扣吨', width: 50},
                { field: 'BALANCE', title: '验收量', width: 70 }
            ]]
             //, onClickRow: function (index, row) {
             //    if (row != null) {
             //        QueryStatReport3(row.MATERIEL_ID, row.SUPPLIER_ID, row.TRANSPORT_ID, row.LPR);
             //    }
             //}
        });
        
        QueryStatReport3();

        $("#StatList").datagrid('load', {
            LPR: '@Html.Raw(ViewBag.LPR)',
            QueryYear: @Html.Raw(ViewBag.QueryYear),
            QueryMonth: @Html.Raw(ViewBag.QueryMonth)
            });
    });
</script>

